package com.example.learnx.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 组织机构表
 * @TableName sys_depart
 */
@TableName(value ="sys_depart")
@Data
public class SysDepart implements Serializable {
    /**
     * ID
     */
    @TableId(value = "id")
    private String id;

    /**
     * 父机构ID
     */
    @TableField(value = "parent_id")
    private String parentId;

    /**
     * 机构/部门名称
     */
    @TableField(value = "depart_name")
    private String departName;

    /**
     * 英文名
     */
    @TableField(value = "depart_name_en")
    private String departNameEn;

    /**
     * 缩写
     */
    @TableField(value = "depart_name_abbr")
    private String departNameAbbr;

    /**
     * 排序
     */
    @TableField(value = "depart_order")
    private Integer departOrder;

    /**
     * 描述
     */
    @TableField(value = "description")
    private String description;

    /**
     * 机构类别 1公司，2组织机构，2岗位
     */
    @TableField(value = "org_category")
    private String orgCategory;

    /**
     * 机构类型 1一级部门 2子部门
     */
    @TableField(value = "org_type")
    private String orgType;

    /**
     * 机构编码
     */
    @TableField(value = "org_code")
    private String orgCode;

    /**
     * 手机号
     */
    @TableField(value = "mobile")
    private String mobile;

    /**
     * 传真
     */
    @TableField(value = "fax")
    private String fax;

    /**
     * 地址
     */
    @TableField(value = "address")
    private String address;

    /**
     * 备注
     */
    @TableField(value = "memo")
    private String memo;

    /**
     * 状态（1启用，0不启用）
     */
    @TableField(value = "status")
    private String status;

    /**
     * 删除状态（0，正常，1已删除）
     */
    @TableField(value = "del_flag")
    private String delFlag;

    /**
     * 对接企业微信的ID
     */
    @TableField(value = "qywx_identifier")
    private String qywxIdentifier;

    /**
     * 创建人
     */
    @TableField(value = "create_by")
    private String createBy;

    /**
     * 创建日期
     */
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 更新人
     */
    @TableField(value = "update_by")
    private String updateBy;

    /**
     * 更新日期
     */
    @TableField(value = "update_time")
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SysDepart other = (SysDepart) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getParentId() == null ? other.getParentId() == null : this.getParentId().equals(other.getParentId()))
            && (this.getDepartName() == null ? other.getDepartName() == null : this.getDepartName().equals(other.getDepartName()))
            && (this.getDepartNameEn() == null ? other.getDepartNameEn() == null : this.getDepartNameEn().equals(other.getDepartNameEn()))
            && (this.getDepartNameAbbr() == null ? other.getDepartNameAbbr() == null : this.getDepartNameAbbr().equals(other.getDepartNameAbbr()))
            && (this.getDepartOrder() == null ? other.getDepartOrder() == null : this.getDepartOrder().equals(other.getDepartOrder()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
            && (this.getOrgCategory() == null ? other.getOrgCategory() == null : this.getOrgCategory().equals(other.getOrgCategory()))
            && (this.getOrgType() == null ? other.getOrgType() == null : this.getOrgType().equals(other.getOrgType()))
            && (this.getOrgCode() == null ? other.getOrgCode() == null : this.getOrgCode().equals(other.getOrgCode()))
            && (this.getMobile() == null ? other.getMobile() == null : this.getMobile().equals(other.getMobile()))
            && (this.getFax() == null ? other.getFax() == null : this.getFax().equals(other.getFax()))
            && (this.getAddress() == null ? other.getAddress() == null : this.getAddress().equals(other.getAddress()))
            && (this.getMemo() == null ? other.getMemo() == null : this.getMemo().equals(other.getMemo()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getDelFlag() == null ? other.getDelFlag() == null : this.getDelFlag().equals(other.getDelFlag()))
            && (this.getQywxIdentifier() == null ? other.getQywxIdentifier() == null : this.getQywxIdentifier().equals(other.getQywxIdentifier()))
            && (this.getCreateBy() == null ? other.getCreateBy() == null : this.getCreateBy().equals(other.getCreateBy()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateBy() == null ? other.getUpdateBy() == null : this.getUpdateBy().equals(other.getUpdateBy()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getParentId() == null) ? 0 : getParentId().hashCode());
        result = prime * result + ((getDepartName() == null) ? 0 : getDepartName().hashCode());
        result = prime * result + ((getDepartNameEn() == null) ? 0 : getDepartNameEn().hashCode());
        result = prime * result + ((getDepartNameAbbr() == null) ? 0 : getDepartNameAbbr().hashCode());
        result = prime * result + ((getDepartOrder() == null) ? 0 : getDepartOrder().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        result = prime * result + ((getOrgCategory() == null) ? 0 : getOrgCategory().hashCode());
        result = prime * result + ((getOrgType() == null) ? 0 : getOrgType().hashCode());
        result = prime * result + ((getOrgCode() == null) ? 0 : getOrgCode().hashCode());
        result = prime * result + ((getMobile() == null) ? 0 : getMobile().hashCode());
        result = prime * result + ((getFax() == null) ? 0 : getFax().hashCode());
        result = prime * result + ((getAddress() == null) ? 0 : getAddress().hashCode());
        result = prime * result + ((getMemo() == null) ? 0 : getMemo().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getDelFlag() == null) ? 0 : getDelFlag().hashCode());
        result = prime * result + ((getQywxIdentifier() == null) ? 0 : getQywxIdentifier().hashCode());
        result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateBy() == null) ? 0 : getUpdateBy().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", parentId=").append(parentId);
        sb.append(", departName=").append(departName);
        sb.append(", departNameEn=").append(departNameEn);
        sb.append(", departNameAbbr=").append(departNameAbbr);
        sb.append(", departOrder=").append(departOrder);
        sb.append(", description=").append(description);
        sb.append(", orgCategory=").append(orgCategory);
        sb.append(", orgType=").append(orgType);
        sb.append(", orgCode=").append(orgCode);
        sb.append(", mobile=").append(mobile);
        sb.append(", fax=").append(fax);
        sb.append(", address=").append(address);
        sb.append(", memo=").append(memo);
        sb.append(", status=").append(status);
        sb.append(", delFlag=").append(delFlag);
        sb.append(", qywxIdentifier=").append(qywxIdentifier);
        sb.append(", createBy=").append(createBy);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateBy=").append(updateBy);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}